home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
1833
/
1833.xpi
/
components
/
yoonoAbout.js
< prev
next >
Wrap
Text File
|
2009-12-16
|
2KB
|
70 lines
// XPCOM stuff
const SERVICE_NAME="About Yoono Page (or, Yoono About)";
const SERVICE_CID = Components.ID("{3c4de21f-22c9-4e8a-bc16-f8e2a69e3707}");
const SERVICE_CTRID = "@mozilla.org/network/protocol/about;1?what=yoono";
const SERVICE_CONSTRUCTOR = YoonoAbout;
const CC = Components.classes;
const CI = Components.interfaces;
function YoonoAbout() {
}
YoonoAbout.prototype = {
newChannel : function(aURI) {
var ios = CC["@mozilla.org/network/io-service;1"].
getService(CI.nsIIOService);
var channel = ios.newChannel(
"chrome://yoono/content/aboutyoono.xul",
null,
null
);
channel.originalURI = aURI;
return channel;
},
getURIFlags: function(aURI) {
return CI.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT;
}
}
// XPCOM registration
var Module = {
registerSelf : function (compMgr, fileSpec, location, type) {
// enregistrement
compMgr.QueryInterface(CI.nsIComponentRegistrar).
registerFactoryLocation(SERVICE_CID, SERVICE_NAME, SERVICE_CTRID, fileSpec, location, type);
},
unregisterSelf : function(compMgr, fileSpec, location) {
// desenregistrement
compMgr.QueryInterface(CI.nsIComponentRegistrar)
.unregisterFactoryLocation(SERVICE_CID, fileSpec);
},
getClassObject : function (compMgr, cid, iid) {
if(cid.equals(SERVICE_CID)) {
return { // nsIFactory
createInstance: function (outer, iid) {
if (outer != null) throw Components.results.NS_ERROR_NO_AGGREGATION;
return new SERVICE_CONSTRUCTOR();
}
};
}
if (!iid.equals(CI.nsIFactory))
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
canUnload : function(compMgr) {
return true;
}
};
function NSGetModule(compMgr, fileSpec) {
return Module;
}